<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2007 XBRL International. All Rights Reserved. -->
<link:linkbase
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:generic="http://xbrl.org/2008/generic"
  xmlns:formula="http://xbrl.org/2008/formula"
  xmlns:variable="http://xbrl.org/2008/variable"
  xmlns:cf="http://xbrl.org/2008/filter/concept"
  xmlns:pf="http://xbrl.org/2008/filter/period"
  xmlns:label="http://xbrl.org/2008/label"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance" 
  xmlns:v="http://xbrl.org/2008/formula/conformance/variable"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:c="http://xbrl.org/formula/conformance/example"
  xsi:schemaLocation="
  http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd
  http://xbrl.org/2008/generic ../../core_schemas/generic-link.xsd
  http://xbrl.org/2008/formula ../../core_schemas/formula.xsd
  http://xbrl.org/2008/variable ../../core_schemas/variable.xsd
  http://xbrl.org/2008/filter/concept ../../core_schemas/concept-filter.xsd
  http://xbrl.org/2008/filter/period ../../core_schemas/period-filter.xsd
  http://xbrl.org/2008/label ../../core_schemas/generic-label.xsd
  ">
  
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/element-label" xlink:href="../../core_schemas/generic-label.xsd#element-label" xlink:type="simple"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-set" xlink:href="../../core_schemas/variable.xsd#variable-set" xlink:type="simple"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-filter" xlink:href="../../core_schemas/variable.xsd#variable-filter" xlink:type="simple"/>  <link:roleRef roleURI="http://www.xbrl.org/2008/role/link" xlink:href="../../core_schemas/generic-link.xsd#standard-link-role" xlink:type="simple"/>
  <link:roleRef roleURI="http://www.xbrl.org/2008/role/label" xlink:href="../../core_schemas/generic-label.xsd#standard-label" xlink:type="simple"/>

  <generic:link xlink:type="extended"
    xlink:role="http://www.xbrl.org/2008/role/link">

    <formula:formula xlink:type="resource" xlink:label="formula" 
      value="$v:beginningBalance + $v:changes"
      source="v:beginningBalance"
      aspectModel="dimensional" implicitFiltering="true">
      <formula:decimals>0</formula:decimals>
      <formula:aspects>
        <formula:period>
          <formula:instant value="xfi:period-end(xfi:period($v:changes))"/>
        </formula:period>
      </formula:aspects>
    </formula:formula>

    <!--  Fact variables.  Note that no general variables are used in this formula. -->
    <variable:factVariable xlink:type="resource" xlink:label="variable_beginningBalance" bindAsSequence="false"  />
    <variable:factVariable xlink:type="resource" xlink:label="variable_changes" bindAsSequence="false"  />

    <!--  Concept filters for the fact variables -->
    <cf:conceptName xlink:type="resource" xlink:label="filter_balance">
      <cf:concept>
        <cf:qname>c:balance</cf:qname>
      </cf:concept>
    </cf:conceptName> 
    <cf:conceptName xlink:type="resource" xlink:label="filter_changes">
      <cf:concept>
        <cf:qname>c:changes</cf:qname>
      </cf:concept>  
    </cf:conceptName> 

    <!--  Labels for the formula and each variable -->
    <label:label xlink:type="resource" xlink:label="formula_label" 
      xlink:role="http://www.xbrl.org/2008/role/label" xml:lang="en">Computes ending balance from beginning balance plus changes.</label:label>
    <label:label xlink:type="resource" xlink:label="variable_beginningBalance_label" 
      xlink:role="http://www.xbrl.org/2008/role/label" xml:lang="en">Binds to any beginning balance</label:label>
    <label:label xlink:type="resource" xlink:label="variable_changes_label" 
      xlink:role="http://www.xbrl.org/2008/role/label" xml:lang="en">Binds to any changes with a duration matching the beginning balance instant</label:label>    
    <!-- Arcs from labels to the formula and variables being labelled -->
    <generic:arc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/element-label"
      xlink:from="formula" xlink:to="formula_label" order="1.0"/>
    <generic:arc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/element-label"
      xlink:from="variable_beginningBalance" xlink:to="variable_beginningBalance_label" order="1.0"/>
    <generic:arc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/element-label"
      xlink:from="variable_changes" xlink:to="variable_changes_label" order="1.0"/>


    <!--  Arc from the formula to the variables it depends on -->
    <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" 
      xlink:from="formula" xlink:to="variable_changes" order="1.0"
      name="v:changes" />
    <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" 
      xlink:from="formula" xlink:to="variable_beginningBalance" order="2.0"
      name="v:beginningBalance" />

    <!--  Arcs from variables to their concept filters -->
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" complement="false" cover="true"
      xlink:from="variable_changes" xlink:to="filter_changes" order="1.0"/>
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" complement="false" cover="true"
      xlink:from="variable_beginningBalance" xlink:to="filter_balance" order="1.0"/>

    <!-- Period filter for the beginning balance variable -->
    <pf:instantDuration xlink:type="resource" xlink:label="filter_changes_period"
    variable="v:changes"
    boundary="start" />
    
    <!-- Arc connecting the changes variable to its period filter -->
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" complement="false" cover="true" 
      xlink:from="variable_beginningBalance" xlink:to="filter_changes_period" order="6.0"/>
    
  </generic:link>

</link:linkbase>
